/*
 * Created on Mar 6, 2004
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package org.vectrics.recruiter.user;

import java.util.Comparator;

/**
 * @author mmoore
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public class ResumeScoreComparator implements Comparator {

	/**
	 * 
	 */
	public ResumeScoreComparator() {
		super();
		// TODO Auto-generated constructor stub
	}


	public int compare(Object arg0, Object arg1) {
		int result = 0;
		ResumeScore resumeScore1 = (ResumeScore)arg0;
		ResumeScore resumeScore2 = (ResumeScore)arg1;
		
		if (resumeScore1.getScore() > resumeScore2.getScore()) {
			result = 1;
		}
		else if (resumeScore1.getScore() < resumeScore2.getScore()) {
			result = -1;
		}
		else {
			result = resumeScore1.getResumeId().compareTo(resumeScore2.getResumeId());
		}
		return(result);
	}

}
